#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
int N, L, P;
constexpr int MAX_STATION = 2 << 20 + 1;
int B[MAX_STATION], A[MAX_STATION];
void solve();
int main() {
    cin >> N >> L >> P;
    for (int i = 0; i < N; i++)
        cin >> A[i];
    for (int i = 0; i < N; i++)
        cin >> B[i];
    solve();
}

void solve() {
    A[N] = L; B[N] = 0; N++; // 平稳过度终点作为一个油箱
    priority_queue<int> oil; int times = 0, pos = 0;
    for (int i = 0; i <= N; i++) {
        int d = A[i] - pos;
        while (P < d) {
            if (oil.empty()) { 
                cout << "-1" << endl;
                return;
            }
            P += oil.top(); oil.pop(); times++;
        }
        P -= d; oil.push(B[i]);
        pos = A[i];
    }
    cout << times;
}